<?php
/**
 * Created by PhpStorm.
 * User: chenxiaogang
 * Date: 2017/11/14
 * Time: 下午2:27
 */

namespace User\Model;


use Common\Model\CommonModel;

class RoleUser extends CommonModel
{
    protected $tableName='role_user';

    /**
     * @use          [得到贷后人员列表]
     */
    public function getDaiHouList(){
        //fixme:查询贷后人员
        $like = '贷后';
        $list = $this->alias('ru')
            ->field(['u.id','u.user_login'])
            ->join('__ROLE__ r on ru.role_id=r.id','left')
            ->join('__USERS__ u on ru.user_id=u.id','left')
            ->where([
                'r.name'=>['like','%'.$like.'%'],
                'u.user_status'=>1
            ])
            ->select();
        return $list;
    }
}